<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/5/12
 * Time: 10:13
 */

namespace app\controllers;

use Yii;

class BusInviteController extends BaseController
{
    /** @var \common\logics\businvite\BusInviteLogic   $BusInviteService **/
    private $BusInviteService;

    public function init()
    {
        $this->BusInviteService = Yii::$container->get("BusInviteService");
        return parent::init();
    }
    //邀请人数显示
    public function actionMyInvite()
    {
        $param = [
            "bus_id" => Yii::$app->request->post("bus_id",0),                 //商家id
            "type" => Yii::$app->request->post("type",0),                     //类型  1，邀请商家  2.邀请买手
            "safetyCode" => Yii::$app->request->post("safetyCode",''),         //安全码
        ];
        $result = $this->BusInviteService->getBusInvite($param);
        return $result;
    }
    //收徒奖励
    public function actionApprentAward()
    {
        $param = [
            "bus_id" => Yii::$app->request->post("bus_id",0),           //买手id
            "safetyCode" => Yii::$app->request->post("safetyCode",""),  //安全码
            "page_num" => Yii::$app->request->post("page_num",1),       //当前页数
            "limit" => Yii::$app->request->post("limit",10),            //每页条数
        ];
        $result = $this->BusInviteService->getApprent($param);
        return $result;
    }
    //任务奖励查询
    public function actionTaskAward()
    {
        $param = [
            "bus_id" => Yii::$app->request->post("bus_id",0),           //买手id
            "safetyCode" => Yii::$app->request->post("safetyCode",""),  //安全码
            "page_num" => Yii::$app->request->post("page_num",1),       //当前页数
            "limit" => Yii::$app->request->post("limit",10),            //每页条数
        ];
        $result = $this->BusInviteService->getTaskReward($param);
        return $result;
    }

}